//
//  WebViewController.m
//  SchoolTimetable
//
//  Created by 梦里都是梦 on 16/1/15.
//  Copyright © 2016年 Yuanlinqian. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()<UIWebViewDelegate>

@end

@implementation WebViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    [self customWebView];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(backBarButtonItemPredded:)];
    // Do any additional setup after loading the view.
    
}
-(void)backBarButtonItemPredded:(UIBarButtonItem *)sender
{
    [AnimationTool setAnimationWith:kCATransitionPush and:kCATransitionFromLeft andTime:0.7 with:self];
    [self.navigationController popViewControllerAnimated:NO];
}
-(void)customWebView
{
    UIWebView * webView = [[UIWebView alloc]initWithFrame:self.view.frame];
    [self.view addSubview:webView];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
//    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"download_header\").style.display=\"none\";"];
    webView.delegate = self;

}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
        [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"download_header\").style.display=\"none\";"];
    

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
